-
You can modify Mark's code slightly to get Logout yourusername
caveats:
i set my module instance to popup-login so the code below will show that, if you are using Mark's code word for word then change the instance of popup-login to mypoplogin as it is in Mark's code;
my theme isn't red so I removed the button-red css class, and just used button button-2 to grab my themes default styling;
{source}
<?php
$user = JFactory::getUser();
$username = $user->username; // bit i added to allow for a more customized greeting
if ($user->guest) { echo "<a href=\"#\" data-rokbox data-rokbox-element=\"#popup-login\"><span class=\"button button-2\">Login</span></a>";} else { echo "<a href=\"#\" data-rokbox data-rokbox-element=\"#popup-login\"><span class=\"button button-2 \">Logout $username</span></a>";}
?>
{/source}
this will give you full functionality of gantry 4 rockettheme login module, login, and logout username.
thanks Mark for sharing the code. the more i use gantry 5 the more I like it, at first it was offputting, as I am used to doing everything via Joomla, but the power of the template backend is amazing and I learn more cool features everyday. it was a major change, but in this case, its good.
-
The following users have thanked you: findhab